<html>
<head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>复制页面内容到粘贴板</title>
    <style type="text/css">
        body { font-family:arial,sans-serif; font-size:9pt; }

        .my_clip_button { width:150px; text-align:center; border:1px solid black; background-color:#ccc; margin:10px; padding:10px; cursor:default; font-size:9pt; }
        .my_clip_button.hover { background-color:#eee; }
        .my_clip_button.active { background-color:#aaa; }
    </style>
    <script type="text/javascript" src="http://keleyi.com/keleyi/phtml/liulanqi/index/KeleyiClipboard.js"></script>
    <script type="text/javascript">
        var clip = null;

        function $(id) { return document.getElementById(id); }

        function init() {
            clip = new ZeroClipboard.Client();
            clip.setHandCursor(true);

            clip.addEventListener('load', function (client) {
                debugstr("准备就绪");
            });

            clip.addEventListener('onClick', function (client) {
                alert($('fe_text'));
                var url = $('fe_text');
                clip.setText(url);
            });

            clip.addEventListener('complete', function (client, text) {
                debugstr("已经把这些文本复制到粘贴板： " + text);
            });

            clip.glue('d_clip_button', 'd_clip_container');
        }
    </script>
</head>
<body onLoad="init()">
<h1>复制页面内容到粘贴板</h1>
<table width="100%">
    <tr>
        <td width="50%" valign="top">
            <!-- Upload Form -->
            <table>
                <tr>
                    <td align="right"><b>文本:</b></td>
                    <td align="left">
                        <a href="HTTP://www.baidu.com/" onchange="clip.setText(this.value)" id="fe_text"  >12312312312312</a>
                    </td>
                </tr>
            </table>
            <br/>
            <div id="d_clip_container" style="position:relative">
                <div id="d_clip_button" class="my_clip_button"><b>复制到粘贴板</b></div>
            </div>
        </td>
    </tr>
</table>

<br/><br/>
在这里粘贴，看看是不是已经复制了上面内容<br/>
<textarea id="testarea" cols=50 rows=10></textarea><br/>
<input type=button value="清空" onClick="$('testarea').value = '';"/>
</body>
</html>